public class Child extends Person {
    private boolean bed;


    public Child(String name, int age, boolean bed) {
        super(name, age);
        this.bed = bed;
    }

    public void money() {
        if (bed) {
            System.out.println("姓名:" + super.getName() + "\t年龄:" + super.getAge() + "\t占用\t本次出行金额:30");
        } else {
            System.out.println("姓名:" + super.getName() + "\t年龄:" + super.getAge() + "\t不占用");
        }
    }
}
